from typing import List


class Solution:
    def heightChecker(self, heights: List[int]) -> int:
        return sum(abs(i - j) > 0 for i, j in zip(heights, sorted(heights)))